package com.yb.bussiness.shoper;

import java.util.List;
import java.util.Map;

import com.yb.domain.VO.BrandType;
import com.yb.domain.VO.PingouVO;
import com.yb.domain.goods.TgBrand;
import com.yb.util.framework.PageUtil;

/**
 * 商家Service
 * 
 * @author Administrator
 * 
 */
public interface BrandService {

	/**
	 * 根据指定参数 分页
	 * 
	 * @param parameMap
	 * @return
	 */
	public PageUtil findAllShoperBy(Map<String, String> parameMap);

	/**
	 * 查询所有商家
	 */
	public List<TgBrand> findAllShoper(Map<String, String> parameMap);

	/**
	 * 论坛页面 展示商家列表
	 */
	public PageUtil findAllShoperTOJulebu(Map<String, String> parameMap);

	/**
	 * 查询总数
	 * 
	 * @param parameMap
	 * @return
	 */
	public int count(Map<String, String> parameMap);

	/**
	 * 查询某个信息
	 * 
	 * @param id
	 * @return
	 */
	public TgBrand findById(String id);

	/**
	 * 审核id
	 */
	public boolean updateAutingId(String id, String autding);

	/**
	 * 通过userid查找品牌
	 * 
	 * @param userid
	 * @return
	 */
	public TgBrand findByUserId(String userid);

	/**
	 * 删除信息
	 * 
	 * @param ids
	 * @return
	 */
	public boolean deleteById(String ids);
	
	/**
	 * 检查是否允许删除
	 * @param ids
	 * @return
	 */
	public boolean checkDel(String ids);

	/**
	 * 查找某市场下所有品牌
	 * 
	 * @param id
	 * @return
	 */
	public List<TgBrand> findByMarketId(Long id, int page, int limit);

	/**
	 * 查找某市场下所有不存在品牌
	 * 
	 * @param id
	 * @return
	 */
	public List<TgBrand> findByMarketIdNotIn(Long id, String categoryId,
			String keyword);

	/**
	 * 通过品牌Id查找其所有产品分类
	 * 
	 * @param id
	 * @return
	 */
	public List<BrandType> findByBrandId(Long id);

	/**
	 * 修改商家信息
	 */
	public boolean saveOrUpdate(TgBrand brand);

	/**
	 * 根据子类别查找符合的品牌
	 * 
	 * @param categoryId
	 * @return
	 */
	public List<TgBrand> findBrandByCategoryId(Long categoryId);

	/**
	 * 根据产品种类查找符合的品牌
	 * 
	 * @param categoryId
	 * @return
	 */
	public List<TgBrand> findBrandByTypeId(Long typeId);

	/**
	 * 根据种类及类别id(第一级)查找相应的拼购产品
	 * 
	 * @param categoryId
	 * @param typeId
	 * @return
	 */
	public Map<String, Object> findBrandByTypeAndCategroy(Long categoryId,
			Long typeId,Long bigCategory, int page, int limit,String name);

	/**
	 * 获取最受欢迎的拼购品牌
	 * 
	 * @return
	 */
	public List<TgBrand> findHotBrand(int start, int limit);

	/**
	 * 获取热门拼购6个月数据
	 * 
	 * @param idAry
	 * @return
	 */
	public List<PingouVO> findPingouList(Long category, int start, int limit);

	/**
	 * 通过类别Id(第一级)获取热门品牌数据
	 * 
	 * @param categoryId
	 * @return
	 */
	public List<TgBrand> findHotBrandByCategory(Long categoryId, int start,
			int limit);

	public List<TgBrand> findAllBrand();

	/**
	 * 通过类别Id(第一级)获取热门广告位品牌数据
	 * 
	 * @param categoryId
	 * @return
	 */
	public List<TgBrand> findAncumentHotBrandByCategory(Long categoryId,
			int start, int limit);

	/**
	 * 通过 sysid查询 TgBrand
	 */
	public TgBrand searchBySysId(int id);

	/**
	 * 通过子类别或者产品种类查找拼购信息
	 * 
	 * @param categoryId
	 * @param typeId
	 * @param start
	 * @param limit
	 * @return
	 */
	public PageUtil findBrandByCategoryIdOrTypeId(Long categoryId, Long typeId,
			int page, int limit);

	public PageUtil findBrandByCategoryIdOrTypeId(Long categoryId, Long typeId,
			int page, int limit, Long marketId);

	/**
	 * 通过子类别或者产品种类查找拼购总人数
	 * 
	 * @param brandId
	 * @param categoryId
	 * @param typeId
	 * @return
	 */
	public Integer findPingouCount(Long brandId, Long categoryId, Long typeId);

	public Integer findTotalCount();

	/**
	 * 通过类别（一级）查找其相应的品牌权重
	 * 
	 * @param categoryId
	 * @return
	 */
	public List<TgBrand> findBrandByCategroyId(Long categoryId);

	public void deleteBrandHot(Long categoryId, Long brandId);

	public void deleteancumentBrandHot(Long categoryId, Long brandId);

	public void deleteancumentBrandHot(Long cid);

	public void updateBrandHot(Long categoryId, Long brandId, Integer weights);

	public void updateBrandHot(Long cid, Integer weights);

	public void updateanncumentBrandHot(Long categoryId, Long brandId,
			Integer weights);

	public void saveBrandWeight(Long categoryId, Long brandId, Integer weights);

	public void saveanncoumentBrandWeight(Long categoryId, Long brandId,
			Integer weights);

	public void saveBrandCategoryWeight(Long categoryId, Long brandId,
			Long typeId, Integer weights);

	public PageUtil findBrand(Long categoryId, Long typeId, int page, int limit);

	public List<TgBrand> findBrandByAnnocumentCategroyId(Long categoryId);

	public void updateBrandCategoryAd(Long categoryId, Long typeId,
			Long brandId, int weights);

	public List<TgBrand> bulidHotTrend();

	/**
	 * 2012-05-8 改用 bulidBrandAd2
	 * @param bigCategoryId
	 * @return
	 */
	public List<TgBrand> bulidBrandAd(Long bigCategoryId);
	
	/**
	 * 查找行业资讯的广告
	 * @param bigCategoryId
	 * @return
	 */
	public List<TgBrand> bulidBrandAd2(Long bigCategoryId);

	public List<TgBrand> bulidBrandAdCategory(Long categoryId);

	public Long findCidByBrandId(Long brandId);

	public Long saveBrand(TgBrand brand);

	/**
	 * 查询方法
	 * 
	 * @param keywords
	 * @return
	 */
	public PageUtil searchByKeyWords(String keywords, int page, int limit);

	public List<TgBrand> findBrandByAnnocumentCategroyId();

	/**
	 * 修改广告位顺序
	 * 
	 * @param sid
	 * @param tid
	 * @param sweight
	 * @param tweight
	 */
	public void modifyAdIndex(Long sid, Long tid, Integer sweight,
			Integer tweight, Integer sindex, Integer tindex);

	public List<TgBrand> findByKeyWord(String keyword);

	/**
	 * 
	 * 替换现有广告的位置
	 * 
	 * @param sid
	 * @param tid
	 */
	public void modifyAd(Long sid, Long tid);

	/**
	 * 查找拼购品牌
	 * 
	 * @param keyword
	 * @return
	 */
	public List<TgBrand> searchPingou4IndexByKey(String keyword, Long cid);

	/**
	 * 添加首页推荐拼购信息
	 * 
	 * @param bid
	 * @param pingouId
	 * @param cid
	 * @param weight
	 */
	public void addPinggouAd(Long bid, Long pingouId, Long cid, int weight);

	public void modifyPingouIndex(Long sid, Long tid, Integer sweight,
			Integer tweight, Integer sindex, Integer tindex);

	public boolean deleteFavorable(String idString);

	public boolean audFavorable(String idString, String autding);

	public boolean deletecases(String idString);

	/**
	 * 变更店铺信息时候变更商家核实状态
	 * 
	 * @param brandId
	 */
	public void changeAuding(Long brandId);

	public void changePingouIndex(Long sid, Long tid, Long pid, Long cid);

	public void deleteInformationAd(Long categoryId, Long brandId, Long typeId);

	public PageUtil findBrand(Map<String,String>map, int page, int limit);

	public boolean changeActivity(String id, String activityFlag);
	
}
